1. Field of the Invention
The present invention relates to an information processing apparatus, and more particularly to a microcomputer having at least an instruction executing unit for decoding and executing instructions, a program memory for storing a program, a program counter for successively indicating addresses in the program memory and outputting stored contents, and an interface means for obtaining data from an external source, all integrated on single semiconductor substrate.
2. Description of the Prior Art
Microcomputers comprise a central processing unit (CPU) for carrying out arithmetic and control operations, a program memory, a data memory, and peripherals such as ports and a timer, all integrated in one chip. Microcomputers find use in various applications including electric appliances for home use, and video and audio devices.
The program of a microcomputer is usually stored in a mask ROM which stores program data written at the time the microcomputer is manufactured, and hence the written program cannot be rewritten after the manufacture of the microcomputer.
Microcomputer programs are generated at the time of development of the application devices which are controlled by the microcomputer. Therefore, it is common for a microcomputer program to be generated while the application device is still incomplete. Microcomputer programs are composed of a large volume of data, e.g., 32 kilobytes of data. Consequently, bugs are frequently found in microcomputer programs before and after the corresponding application devices are perfected.
If a microcomputer program bug is found after a microcomputer has been manufactured, the manufactured microcomputer is unusable because the program cannot be corrected by rewriting. Since new electric appliances for home use, for example, are manufactured in quantities of several tens of thousands of units for introduction into the market, a bug in the microcomputer program of a microcomputer costing about five hundred yen can result in a loss of several tens of millions yen. If microcomputers with program bugs have already been installed in application devices, the necessity of discarding the defective application devices results in even greater losses. Even bugs in a microcomputer program can be corrected, the need to reorder and manufacture the microcomputers entails high costs. Inasmuch as application devices cannot be manufactured until microcomputers with a corrected program are available, the sale of the application devices is delayed and the opportunity to sell them is lost.
To eliminate the above problems, Japanese Patent Laid No. 186927/91 discloses a method of rewriting a certain portion of a program for a microcomputer with another program after the microcomputer has been manufactured. The disclosed method employs a nonvolatile memory as an external storage device which is often used in the application of microcomputers. The nonvolatile memory is used to store settings which differ from system to system, such as data for adjusting mechanical variations of application systems, after the application systems have been manufactured. The nonvolatile memory has an empty storage area for storing the address of a bug and a corrected program. When the microcomputer operates in a special mode, the address of the bug and the corrected program are transferred from the nonvolatile memory and stored in a dedicated memory (RAM) in the microcomputer. When the address of the bug is reached, the dedicated memory is selected rather than the internal program memory, thus executing the corrected program. Because the external nonvolatile memory is required irrespective of whether there is a bug or not, any program bugs can be corrected without substantially modifying the application device.
According to the disclosed method, however, since the microcomputer needs to operate in a special mode for the correction of bugs, it is necessary to provide the microcomputer with a dedicated terminal or apply a special signal to change modes for operating the microcomputer in the bug correcting mode. If the dedicated terminal is employed, then the number of function terminals of the microcomputer is reduced, and if the special signal is applied, then an external circuit for generating the special signal is required. Another problem is that the presence of the dedicated terminal or the external circuit gives a clear visible sign of a program bug, indicating that the corrected program is stored in the external nonvolatile memory. As the nonvolatile memory can easily be read and the format in which the corrected program is stored in the nonvolatile memory is available to others as functional specifications of the microcomputer, part of the program can be read by others, possibly resulting in a violation of the copyright or a leakage of classified information. Furthermore, the dedicated memory, which is selected to execute the corrected program rather than a program portion containing a bug, is required to have the same capacity as the program portion containing a bug. In the event that a program bug is large and cannot easily be corrected, limited capacity may allow only the deletion of the program portion containing the bug without capacity to perform other functions. According to the disclosed method, however, such an alternative cannot be chosen, and a program bug cannot be corrected if the capacity of the program portion containing the bug exceeds the capacity of the dedicated memory. If the program contains no bug at all, on the other hand, then the dedicated memory is useless hardware, and the cost effectiveness of the microcomputer is greatly lowered.